#include<iostream>
using namespace std;
struct Node
{
    int data;
    Node *next;
};
Node *create(int n){
    Node *s,*head,*tail;
    int x;
    for(int i=0;i<n;i++){
        cin>>x;
        s=new Node;
        s->data=x;
        if(i==0){
            head=s;
            tail=s;
        }
        else{
            tail->next=s;
            tail=s;
        }
    }
    tail->next=NULL;
    return head;
}
//遍历
void display(Node *head){
    Node *p;
    p=head;
    while(p!=NULL){
        cout<<p->data<<" ";
        p=p->next;
    }
}
int main(){
    int n;
    cin>>n;
    Node *head=create(n);
    display(head);

    return 0;
}
